<?php

namespace app\qo;

/**
 * Class BaseQo
 * @package app\qo
 */
class BaseQo
{
    private $_data = [];

    /**
     * BaseQo constructor.
     * @param array $params
     */
    public function __construct(array $params = [])
    {
        foreach ($params as $key => $item) {
            $this->_data[$key] = $item;
        }
    }

    /**
     * @param $name
     * @param $value
     */
    public function __set($name, $value)
    {
        $this->_data[$name] = $value;
    }

    /**
     * @param $name
     * @return mixed|null
     */
    public function __get($name)
    {
        return $this->_data[$name] ?? null;
    }

    /**
     * @return array
     */
    public function getData(): array
    {
        return $this->_data;
    }
}